package com.blog.common.vo;

import java.io.Serializable;

/**
 * @ClassName:JsonResult
 * @Author:wubo
 * @Data:2020/7/28 10:14
 */
public class JsonResult implements Serializable {
    private static final long serialVersionUID = -2676880942035350299L;
    private String msg;
    /**200成功  201失败*/
    private Integer status=200;
    private Object data;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static JsonResult success(){return new JsonResult();}

    public static JsonResult success(String msg , Object data){
        return new JsonResult(msg,data);
    }

    public static JsonResult success(Object data){
        return new JsonResult("操作成功！",data);
    }

    public static JsonResult success(String msg){
        return new JsonResult(msg);
    }

    public static JsonResult fail(String msg){
        return new JsonResult(msg,201);
    }

    public static JsonResult fail(Object data){
        return new JsonResult(201,data);
    }
    public static JsonResult fail(Object data, String msg){
        return new JsonResult(msg,201,data);
    }

    public static JsonResult fail(){return new JsonResult(201);}

    public JsonResult() {
    }

    public JsonResult(String msg, Integer status, Object data) {
        this.msg = msg;
        this.status = status;
        this.data = data;
    }

    public JsonResult(String msg, Object data) {
        this.msg = msg;
        this.data = data;
    }

    public JsonResult(String msg, Integer status) {
        this.msg = msg;
        this.status = status;
    }

    public JsonResult(Integer status, Object data) {
        this.status = status;
        this.data = data;
    }

    public JsonResult(Integer status) {
        this.status = status;
    }

    public JsonResult(String msg) {
        this.msg = msg;
    }


}
